use serde::{Deserialize, Serialize};

use wither::{
    bson::{oid::ObjectId, DateTime},
    Model,
};
#[derive(Debug, Clone, Serialize, Deserialize, Model)]
pub struct UserLoginLogModel {
    #[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
    pub id: Option<ObjectId>,
    pub user_id: Option<ObjectId>,
    pub ip: Option<String>,
    pub created_at: DateTime,
}
impl Default for UserLoginLogModel {
    fn default() -> Self {
        Self {
            id: None,
            user_id: None,
            ip: None,
            created_at: DateTime::now(),
        }
    }
}
